<script>
	export default {
		onLaunch: function() {
			let cart = JSON.parse(uni.getStorageSync('cart') || '[]');
			let count = 0;
			cart.forEach(item=>{
				count += item.goods_count;
			})
			uni.setTabBarBadge({
			  index: 2,
			  text:count.toString()
			})
			console.log('App Launch')
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	/*每个页面公共css */
</style>
